<el-dialog :close-on-click-modal="false"  :close-on-press-escape="false"  :visible.sync="mixinEdit_editVisible" class="dialogStyleBase" title="设置" width="1000px"
    :before-close="handleClose" top="20px" append-to-body>
    <div class="dialog-box" v-loading="load">

        <el-form ref="editForm" :model="form" label-width="120px" label-position="left">

            <LayoutCell>
                <LayoutCellItem title="规则设置">
                    <el-form-item label="抵扣规则" prop="minDeductUnit"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorMinDeductUnit(rule, value, callback)}}]">
                        <el-input v-model="form.minDeductUnit" style="width: 300px" size="mini" maxlength="10"
                            onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))">
                            <template slot="prepend">1元等于</template>
                            <template slot="append">{{assetName}}</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="开启状态">
                        <el-switch v-model="form.defaultOpenFlag" active-text="已开启" inactive-text="未开启"
                            :active-value="1" :inactive-value="0">
                        </el-switch>
                    </el-form-item>
                </LayoutCellItem>
                <LayoutCellItem title="抵用设置" v-show="form.defaultOpenFlag">
                    <el-form-item label="抵扣">
                        <el-checkbox v-model="form.isOpenOrderAmount" :true-label="1" :false-label="0">商品金额
                        </el-checkbox>
                        <el-checkbox v-model="form.isOpenFreight" :true-label="1" :false-label="0">运费
                        </el-checkbox>
                    </el-form-item>

                    <el-form-item label="抵扣商品" v-if="form.isOpenOrderAmount">
                        <el-radio-group v-model="form.productType">
                            <el-radio :label="1">全部商品</el-radio>
                            <el-radio :label="2">部分商品参与</el-radio>
                            <el-radio :label="3">部分商品不参与</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item v-if="form.isOpenOrderAmount && form.productType !== 1">
                        <!-- <SelectGoods :data.sync="selectGoodsValue.data" :type.sync="selectGoodsValue.type"
                            :options="selectGoodsValue.options" @change="selectGoodsChange" :appWindow="appWindow">
                        </SelectGoods> -->
                        <!-- //count 选择商品数量  -1 不限制  0不可选择 正整数为可选多少项 -->

                        <SelectDataGoods v-model="goodsIds" :appWindow="appWindow" :counts="-1"
                            :apiConfig="$vFN.Tools.getAppGlobalData('componentsApiConfig.SelectDataGoods',appWindow)">
                        </SelectDataGoods>
                    </el-form-item>

                    <el-form-item label="折扣数量" prop="minUseNumber"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorMinUseNumber(rule, value, callback)}}]">
                        <el-checkbox v-model="form.isOpenMinUse" :true-label="1" :false-label="0" @change="validate">
                            最少使用</el-checkbox>
                        <el-input v-model="form.minUseNumber" style="width: 200px;margin-left: 20px;" maxlength="10"
                            :disabled="!form.isOpenMinUse">
                            <template slot="append">{{assetName}}</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item prop="maxUseNumber"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorMaxUseNumber(rule, value, callback)}}]">
                        <el-checkbox v-model="form.isOpenMaxUse" :true-label="1" :false-label="0" @change="validate">
                            最多使用
                        </el-checkbox>
                        <el-input v-model="form.maxUseNumber" style="width: 200px;margin-left: 20px;" maxlength="10"
                            :disabled="!form.isOpenMaxUse">
                            <template slot="append">{{assetName}}</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item prop="orderAmountProportion"
                        :rules="[{trigger: ['blur', 'change'] ,validator:function(rule, value, callback){validator(rule, value, callback)}}]">
                        <el-checkbox v-model="form.isOpenOrderAmountProportion" :true-label="1" :false-label="0"
                            @change="validate">
                            抵扣项目金额比例
                        </el-checkbox>
                        <el-input v-model="form.orderAmountProportion" style="width: 200px;margin-left: 20px;"
                            :disabled="!form.isOpenOrderAmountProportion">
                            <template slot="append">%</template>
                        </el-input>
                    </el-form-item>

                    <el-form-item label="按比例返还">
                        <el-radio-group v-model="form.isOpenReturn" @change="validate">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="结算方式">
                        <el-radio-group v-model="form.conditionNode" @change="validate">
                            <el-radio :label="1">付款后</el-radio>
                            <el-radio :label="2">完成后</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item v-show="form.isOpenReturn" label="比例设置" prop="returnPercentage"
                        :rules="[{trigger: ['blur', 'change'] ,validator:function(rule, value, callback){validator2(rule, value, callback)}}]">
                        <el-input v-model="form.returnPercentage" style="width: 300px;" :disabled="!form.isOpenReturn">
                            <template slot="prepend">商品实付金额的</template>
                            <template slot="append">%</template>
                        </el-input>
                    </el-form-item>
                </LayoutCellItem>
            </LayoutCell>


        </el-form>

    </div>
    <template slot="footer">
        <el-button type="primary" @click="submit">确定</el-button>
    </template>
</el-dialog>